package com.example.iread.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.iread.bean.UserBean;

import java.util.List;

@Dao
public interface UserDao {

    @Insert
    void insert(UserBean ...userBeans);

    @Delete
    void delete(UserBean ...userBeans);

    @Query("DELETE FROM user WHERE id = :id")
    void deleteById(int id);

    @Update
    void update(UserBean ...userBeans);

    @Query("SELECT * FROM user")
    List<UserBean> getList();

    @Query("SELECT * FROM user LIMIT 1")
    UserBean getOne();

    @Query("DELETE FROM user")
    void clear();

}
